package com.kangfu.api.controller;

import com.kangfu.db.model.vo.BannerVo;
import com.kangfu.api.service.IBannerService;
import com.kangfu.common.annotation.IgnoreAuth;
import com.kangfu.common.model.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/banner")
public class BannerController {

    @Autowired
    public IBannerService bannerService;

    @GetMapping("")
    @IgnoreAuth
    public AjaxResult getBanner(@RequestParam(name = "type", defaultValue = "0") int type) {
        List<BannerVo> bannerList = bannerService.selectBannerList(type);
        return AjaxResult.success(bannerList);
    }
}
